package com.ruoyi.common.config;

import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class SmsConfig implements InitializingBean {

  @Value("${aliyun.access.keyid}")
  private String keyId;
  @Value("${aliyun.access.keysecret}")
  private String keySecret;
  @Value("${aliyun.sms.sign}")
  private String sign;

  public static String ACCESS_KEY_ID;
  public static String ACCESS_KEY_SECRET;
  public static String SMS_SIGN;

  @Override
  public void afterPropertiesSet() throws Exception {
    ACCESS_KEY_ID = StringUtils.getStrOrDefault(this.keyId,"");
    ACCESS_KEY_SECRET = StringUtils.getStrOrDefault(this.keySecret,"");
    SMS_SIGN = StringUtils.getStrOrDefault(this.sign,"");
  }
}
